<?php
namespace plugin\videoappdownload\validate;

use app\common\validate\BaseValidate;

class AdValidate extends BaseValidate
{
    protected $rule = [
    ];

    protected $message = [
              'id.require' => 'id不得为空',
              
              'id.number' => 'id必须为数字',
              
              'id.max' => 'id不能超过20个字符',
              
              'img.require' => '广告图片不得为空',
              
              'img.max' => '广告图片必须是字符串类型',
              
              'img.max' => '广告图片不能超过255个字符', 
              //数据验证提示
                      ];

    /**
      * @notes  switch_open
      * @date 2023-11-22 10:11:23
      * @author 半米科技低代码一键生成
      */
    public function sceneswitch_open()
    {
        return $this->append('id', 'require|number|length:0,20');
    }

    /**
      * @notes  edit
      * @date 2023-11-22 10:11:23
      * @author 半米科技低代码一键生成
      */
    public function sceneedit()
    {
        return $this->append('id', 'require|number|length:0,20')->append('img', 'require|length:0,255');
    }

    //数据验证方法
}
